<h2><%= @topic.name -%></h2>

<h3>
  <%= link_to 'Forums', mobile_forums_path -%> >
  <%= link_to @topic.forum.name, mobile_topics_path(:forum_id => @topic.forum) -%> >
  <%= @topic.name -%>
</h3>

<p>
<% if is_logged_in? -%>
  <%= link_to 'Post Reply', mobile_new_post_path(:forum_id => @topic.forum, :topic_id => @topic) -%>
<% else -%>
  <%= link_to 'Login to post a new topic', mobile_login_url -%>
<% end -%>
</p>

<% if @posts_pages.page_count > 1 %>
  <p class="pagination">Pages: <strong>
    <%= pagination_links @posts_pages, :params => params %>
  </strong></p>
<% end %>

<% @posts.each do |post| -%>
  <p>
    <%= link_to  post.user.username, mobile_user_path(post.user) -%> said:<br />
    <%=h post.body -%>
  </p>
<% end -%>

<% if @posts_pages.page_count > 1 %>
  <p class="pagination">Pages: <strong>
    <%= pagination_links @posts_pages, :params => params %>
  </strong></p>
<% end %>
